package com.da.javatest.leetCode;

/**
 * @author chenlida
 * @date 2018/12/15 16:04
 * @description
 */
public class Code921 {
    public int minAddToMakeValid(String S) {
        if (S.contains("()")) {
            S = S.replace("()", "");
            return minAddToMakeValid(S);
        } else {
            return S.length();
        }
    }

}
